package cn.kgc.form;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author YC
 */
@Data
@ApiModel
public class UsersAddForm implements Serializable {


//    /**
//     * id
//     */
//    @ApiModelProperty(value = "id", dataType = "java.lang.Integer")
//    private Integer userId;


    /**
     * 名字
     */
    @ApiModelProperty(value = "名字", dataType = "java.lang.String")
    @NotBlank(message = "名字不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{3,10}$", message = "名字格式不正确")
    private String userName;


//    /**
//     * 密码
//     */
//    @ApiModelProperty(value = "密码", dataType = "java.lang.String")
//    private String userPwd;


    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱", dataType = "java.lang.String")
    @NotBlank(message = "邮箱不能为空")
    @Pattern(regexp = "^[0-9a-zA-Z]+@[0-9a-zA-Z]{2,}\\.[a-zA-Z]{2,}$", message = "邮箱格式不正确")
    private String userEmail;


    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号", dataType = "java.lang.String")
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1\\d{10}$", message = "手机号格式不正确")
    private String mobile;


    /**
     * 性别(1男 2 女)
     */
    @ApiModelProperty(value = "性别(1男 2 女)", dataType = "java.lang.Integer")
    @Range(min = 1, max = 2, message = "性别只可选择男或女")
    private Integer sex;


    /**
     * 部门id
     */
    @ApiModelProperty(value = "部门id", dataType = "java.lang.Integer")
    @Min(value = 1, message = "请选择部门")
    private Integer deptId;


    /**
     * 工作
     */
    @ApiModelProperty(value = "工作", dataType = "java.lang.String")
    @NotBlank(message = "工作不能为空")
    private String job;


    /**
     * 状态(1在职 2离职 3试用期)
     */
    @Range(min = 1, max = 3, message = "状态只可选择在职、离职或试用期")
    @ApiModelProperty(value = "状态(1在职 2离职 3试用期)", dataType = "java.lang.Integer")
    private Integer state;


    /**
     * 角色ID
     */
    @ApiModelProperty(value = "角色ID", dataType = "java.lang.Integer")
    @Min(value = 1, message = "请选择角色")
    private Integer roleId;


}
